//
//  AppDelegate+Timer.m
//  Root
//
//  Created by apple on 2017/3/18.
//  Copyright © 2017年 com.GooHarbour. All rights reserved.
//

#import "AppDelegate+Timer.h"
static NSInteger TotalSeconds;
@implementation AppDelegate (Timer)
-(void)runSystemTimer
{
    if(self.timer==nil)
    {
        self.timer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(changeSeconds) userInfo:nil repeats:YES];
    }
    [[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
}
-(void)changeSeconds
{
    TotalSeconds+=1;
    [[NSNotificationCenter defaultCenter] postNotificationName:systemTimer object:@(TotalSeconds)];
}
@end
